
<#include "/common/head.html"/>

 <div class="easyui-panel updatePage" data-options="fit:true,border:false">
    <form id="ff" class="easyui-form" method="post">
        <table class="table1">
        	
            <tr>
           		<th><span>托盘编号（#）：</span></th>
               	<td colspan="4">
               		<!-- <input class="easyui-textbox" type="text" name="tp_no" value="${model.tp_no!''}" data-options="readonly:true"></input> -->
           			<span class="valueSpan">${model.tp_no!''}</span>
           		</td>           		
           	</tr>
           	<tr>
           		<th><span>每盘唯一条码：</span></th>
               	<td>
               		<input class="easyui-textbox" type="text" id="realid" name="realid" value="${model.realid!''}" data-options=""></input>
           		</td>
           		<th><span>物料编号：</span></th>
               	<td>
               		<input class="easyui-textbox" type="text" id="mat_no" name="mat_no" value="${model.mat_no!''}" data-options=""></input>
           		</td>
            </tr>
            <tr>
           		<th><span>物料名称：</span></th>
               	<td>
               		<input class="easyui-textbox" type="text" id="mat_name" name="mat_name" value="${model.mat_name!''}" data-options=""></input>
           		</td>
           		
           		<th><span>物料数量：</span></th>
               	<td>
               		<input class="easyui-textbox" type="text" id="mat_num" name="mat_num" value="${model.mat_num!''}" data-options="required:true"></input>
           		</td>
           		
            </tr>
            <tr>
           		<th><span>生产日期：</span></th>
               	<td>
               		<input class="easyui-datetimebox" type="text" id="pro_date" name="pro_date" value="${model.pro_date!''}" data-options="required:true"></input>
           		</td>
           		
           		<th><span>存入时间：</span></th>
               	<td>
               		<input class="easyui-datetimebox" type="text" id="in_time" name="in_time" value="${model.in_time!''}" data-options="required:true"></input>
           		</td>
           		
            </tr>
            <tr>
           		<th><span>离库时间：</span></th>
               	<td>
               		<input class="easyui-datebox" type="text" id="out_time" name="out_time" value="${model.out_time!''}" data-options=""></input>
           		</td>
           		
           		<th><span>操作人员：</span></th>
               	<td>
               		<input class="easyui-textbox" type="text" id="create_user" name="create_user" value="${session['sysUser'].user_name}" data-options=""></input>
           		</td>
           		
            </tr>
            <tr>
           		<th><span>所属库位：</span></th>
               	<td>
               	<!-- 	<input class="easyui-textbox" type="text" name="of_loc" value="${model.of_loc!''}" data-options="readonly:true"></input> -->
               		<input class="easyui-combobox" id="of_loc" name="of_loc" value="${model.of_loc!''}" data-options="
	            				valueField: 'id',
   								textField: 'text',
	            				data: [
	            					{id:'', text:''}<#list dictDataLoc_id.keySet() as key>,{id:'${key}', text:'${dictDataLoc_id.get(key)}'}</#list>
	            				],
	            				readonly:true
	            				
	            	" /> 
           		</td>
           		<th><span>所属仓库：</span></th>
               	<td>
               		<span class="valueSpan">${storage_name!''}</span>
           		</td>     
            </tr>
        </table>
    </form>
</div>  
<script>
top.window.subPage.save = save;
function save() {
	if($("#zcurdHeadTable").form('validate')) {
		$.post("update", getParam(), function(data) {
			top.window.closeWindow();
			top.window.subPage.loadCurrDatagrid();
		});
	}
}
function getParam() {
	var param = {
	     
	    "id": ${model.id}, 
       	    "model.tp_no": getInputValue("tp_no"), 
       	    "model.mat_no": getInputValue("mat_no"), 
       	    "model.mat_name": getInputValue("mat_name"), 
       	    "model.mat_num": getInputValue("mat_num"), 
       	    "model.pro_date": getInputValue("pro_date"), 
       	    "model.in_time": getInputValue("in_time"), 
       	    "model.out_time": getInputValue("out_time"), 
       	    "model.create_user": getInputValue("create_user"), 
       	    "model.of_loc": getInputValue("of_loc"), 
       	    "model.of_storage": getInputValue("of_storage"), 
       	    "model.realid": getInputValue("realid"),
	}
	for(key in param) {
		if(!param[key]) {
			delete param[key];
		}
	}
	return param;
} 
//扫码枪扫入唯一码
  $(document).ready(function () {
      $('#realid').textbox('textbox').keydown(function (e) {
          if (e.keyCode == 13) {        	  
        	  $('#mat_no').textbox("setValue",'00AD2HB001-R');
  	          $('#mat_name').textbox("setValue",'下盖');  
  	          $('#mat_num').textbox("setValue",'5000X');  
  	          $('#pro_date').textbox("setValue",'2017-01-20 16:47:16');
  	          $('#in_time').textbox("setValue",'2017-01-20 16:47:16');
        	  $.post("update", getParam(), function(data) {
      			if(data.result=="success"){      				
        			top.window.closeWindow();
      				top.window.subPage.loadCurrDatagrid();
      			}
      			else{
      				alert(data.msg);
      			}
      		});
          }
      });
  }); 
//扩展js
</script>
<#include "/busi/wms/material/material_select.html"/>
<#include "/common/foot.html"/>
